package com.foreknow.hospital.service.impl;

import com.foreknow.hospital.dao.HospitalDao;
import com.foreknow.hospital.dao.impl.HospitalDaoImpl;
import com.foreknow.hospital.po.Hospital;
import com.foreknow.hospital.service.HospitalService;
import com.foreknow.hospital.util.DBUtil;

import java.util.List;

public class HospitalServiceImpl implements HospitalService {

    @Override
    public List<Hospital> listHospitalByOrderTypeId(int orderTypeId) {
        HospitalDao hospitalDao = new HospitalDaoImpl();
        List<Hospital>list=null;
        try{
            list=hospitalDao.listHospitalByOrderTypeId(orderTypeId);
        }catch(Exception e){

        }finally{
            DBUtil.close();
        }
        return list;
    }

    @Override
    public Hospital getHospitalById(int HpId) {
        HospitalDao hospitalDao=new HospitalDaoImpl();
        Hospital hospital=null;
        try{
            hospital=hospitalDao.getHospitalById(HpId);
        }catch (Exception e){
        }finally{
            DBUtil.close();
        }

        return hospital;
    }
}
